package com.lzxuni.modules.enclosure.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.lzxuni.modules.common.entity.FileEntity;
import com.lzxuni.modules.common.entity.PageParameter;
import com.lzxuni.modules.enclosure.mapper.EnclosureMapper;
import com.lzxuni.modules.enclosure.service.EnclosureService;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class EnclosureServiceImpl extends ServiceImpl<EnclosureMapper, FileEntity> implements EnclosureService {

    @Override
    public PageInfo<FileEntity> queryPage(PageParameter pageParameter, FileEntity fileEntity) {
        PageHelper.startPage(pageParameter.getPage(), pageParameter.getRows()).setOrderBy(
                pageParameter.getSidx() + " " + pageParameter.getSord());
        List<FileEntity> fileEntityList = baseMapper.queryList(fileEntity);
        PageInfo<FileEntity> pageInfo = new PageInfo<>(fileEntityList);
        return pageInfo;
    }

}
